package com.passncool.testbed.network;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerSocketTest
{
    private final static int DEFAULT_PORT = 12000;

    private final static String HOST = "localhost";

    public static void main(String[] args)
    {
        try
        {
            ServerSocket sock = new ServerSocket(DEFAULT_PORT, 10);
            
            while(true)
            {
                Socket sock2 = sock.accept();
                Writer writer  = new OutputStreamWriter(sock2.getOutputStream());
                writer.write("This Server Connection. \r\n");
                writer.flush();
                writer.close();
            }
            
        }
        catch (IOException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}
